<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta name="keywords" th:content="${@config.getKey('blog.index.keywords')}">
	<meta name="description" th:content="${@config.getKey('blog.index.description')}">
	<title th:text="${@config.getKey('blog.index.title')}"></title>

	<link rel="stylesheet" th:href="@{/blog/jxhx/css/base.css}" />
	<link rel="stylesheet" th:href="@{/blog/jxhx/css/m.css}" />
	<link rel="stylesheet" th:href="@{/ajax/libs/font-icon/icon.css}"/>
	<link th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
	<link th:href="@{/ajax/libs/toastr/toastr.min.css}" rel="stylesheet"/>

	<script th:src="@{/blog/jxhx/js/jquery-1.8.3.min.js}"></script>
	<script th:src="@{/blog/jxhx/js/comm.js}"></script>
	<script th:inline="javascript"> var ctx = [[@{/}]]; </script>
	<script th:src="@{/ajax/libs/layer/layer.min.js}"></script>
	<script th:src="@{/ruoyi/js/fast.js}"></script>
	<script th:src="@{/ajax/libs/toastr/toastr.min.js}"></script>
	<style>
		header {
			height: 60px !important;
		}
		header ul li a:hover{text-decoration: none;}
	</style>
</head>
<body style="background: #E9EAED !important;">
<div th:replace="blog/theme/jxhx/fragments/navbar"></div>

<article>
	<div class="whitebg about">
		<h2 class="gd_title">申请友链</h2>
		<p class="ab_dubai" style="line-height: 2.0;color:#96969c;border-bottom: 1px dashed #ddd;padding-bottom: 12px;">
			在申请本站友链之前请确保已将本站加入友链。<br>

			本站优先录入同类原创、技术生活类博客。任何包含违法国家法律或不健康内容站点均不录入。<br>

			百度、搜狗等搜索引擎权重无要求，但是要求时常更新网站内容。<br>

			本站会不定期互相走访友链，发现单方取消友链便拉入黑名单。<br>

			特别提醒: 若无意外，在申请友链后24小时内完成审核并录入站点，如超时还未审核完成，请留言或者私信给我。审核结果均以邮件形式通知，请输入常用有效邮箱
		</p>

		<form class="form-horizontal" id="form-apply">

			<div class="form-group">
				<label class="col-sm-2 "  style="max-width: 110px;line-height: 2.5;"><font color="red">*</font>站点名称：</label>
				<div class="col-sm-5">
					<input id="name" name="name" placeholder="站点名称" class="form-control" type="text" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 "  style="max-width: 110px;line-height: 2.5;"><font color="red">*</font>邮箱地址：</label>
				<div class="col-sm-5">
					<input id="email" name="email"  placeholder="邮箱地址" class="form-control" type="text" required>
				</div>
			</div>
			<div class="form-group" >
				<label class="col-sm-2 " style="max-width: 110px;line-height: 2.5;"><font color="red">*</font>站点地址：</label>
				<div class="col-sm-5">
					<input id="link" name="link"   placeholder="站点地址" class="form-control" type="text" required>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-2 "  style="max-width: 110px;line-height: 1.5"><font color="red">*</font>站点描述：</label>
				<div class="col-sm-5">
					<textarea id="description" name="description"  placeholder="站点描述"  class="form-control"></textarea>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 "  style="max-width: 110px;"></label>
				<div class="col-sm-5">
					<button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>提 交</button>&nbsp;
					<button type="reset" class="btn btn-sm btn-danger" ><i class="fa fa-reply-all"></i>重 置 </button>
				</div>
			</div>

		</form>
	</div>
</article>
<div th:replace="blog/theme/jxhx/fragments/footer"></div>

<script>
	function submitHandler(){
		var name=$("#name").val();
		if(isEmpty(name)){
        	Fast.msg_error("站点名称不能为空！");
        	return;
		}

        var email=$("#email").val();

        if(isEmpty(email)){
            Fast.msg_error("邮箱不能为空！");
            return;
        }

        var link=$("#link").val();
        if(isEmpty(link)){
            Fast.msg_error("链接不能为空！");
            return;
        }
        var description=$("#description").val();
        if(isEmpty(description)){
            Fast.msg_error("站点描述不能为空！");
            return;
        }
        var data={
        	"name":name,
			"email":email,
			"link":link,
			"description":description
        }
        $.ajax({
            type: "post",
            url: ctx+"blog/applyFriendLink",
            data: data,
            dataType: "json",
            success: function(json) {
                if (json.code == 0) {
                   Fast.msg_success(json.msg);
                    document.getElementById("form-apply").reset();
                } else {
                    Fast.msg_error(json.msg)
                }
            }
        });

    }
    /*加载底部前执行。ps：防止闪现
     控制当页面内容过少时，底部仍在屏幕最下方
     主体内容最小高度
     */
    var topHeight=140;//头部高度
    var footerHeight=191;//底部高度
    var contentMinHeight = $(window).height()-topHeight-footerHeight;
    $(".about").css("min-height",contentMinHeight)
    $(window).resize(function(){
        var contentMinHeight = $(window).height()-topHeight-footerHeight;
        $(".rightGrid").css("min-height",contentMinHeight)
    })
</script>
</body>

</html>